package com.junbao.message.infrastructure.core;

import com.lmax.disruptor.RingBuffer;


public abstract class DataProducer<T> {

	/**
	 * 消息生产者名称为消息类型名称，
	 * 比如消息类型为order,消息生产者名称为order的全路径
	 */
	protected String producerName;
		
	protected RingBuffer<T> ringBuffer;
	
	public DataProducer(String producerName,RingBuffer<T> ringBuffer) {
		this.ringBuffer = ringBuffer;
		this.producerName = producerName;
	}

	public abstract void sendData(T eventData);

	public String getProducerName() {
		return producerName;
	}

	public void setProducerName(String producerName) {
		this.producerName = producerName;
	}

	public RingBuffer<T> getRingBuffer() {
		return ringBuffer;
	}

	public void setRingBuffer(RingBuffer<T> ringBuffer) {
		this.ringBuffer = ringBuffer;
	}

}
